cmake_minimum_required(VERSION 3.10)
project(rec2-mips)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(spdlog REQUIRED)
find_package(OpenMP)

#add_executable(parhip dataset-partition/graph-partition/parhip_test.cpp)
#TARGET_LINK_LIBRARIES(parhip /home/zhengbian/software/KaHIP/deploy/libparhip.a)
#include_directories(/home/zhengbian/software/KaHIP/deploy)

#add_executable(rri src/app/ReverseRankIndex.cpp)
#target_include_directories(rri PRIVATE src/include src/impl ${armadillo_SOURCE_DIR}/include ${Boost_INCLUDE_DIRS})
#target_link_libraries(rri PRIVATE armadillo BLAS::BLAS pthread gfortran OpenMP::OpenMP_CXX spdlog::spdlog ${Boost_LIBRARIES})

add_executable(json_test test/json_test.cpp)
target_include_directories(json_test PRIVATE src/include)

add_executable(amazon src/app/Amazon.cpp)
target_include_directories(amazon PRIVATE src/include)
target_link_libraries(amazon PRIVATE OpenMP::OpenMP_CXX spdlog::spdlog)

add_executable(amazon_home_kitchen src/app/AmazonHomeKitchen.cpp)
target_include_directories(amazon_home_kitchen PRIVATE src/include)
target_link_libraries(amazon_home_kitchen PRIVATE OpenMP::OpenMP_CXX spdlog::spdlog)

add_executable(bookcrossing src/app/BookCrossing.cpp)
target_include_directories(bookcrossing PRIVATE src/include)
target_link_libraries(bookcrossing PRIVATE OpenMP::OpenMP_CXX spdlog::spdlog)

add_executable(goodreads src/app/Goodreads.cpp)
target_include_directories(goodreads PRIVATE src/include)
target_link_libraries(goodreads PRIVATE OpenMP::OpenMP_CXX spdlog::spdlog)

add_executable(movielens27m src/app/MovieLens27m.cpp)
target_include_directories(movielens27m PRIVATE src/include)
target_link_libraries(movielens27m PRIVATE OpenMP::OpenMP_CXX spdlog::spdlog)

add_executable(netflix src/app/Netflix.cpp)
target_include_directories(netflix PRIVATE src/include)
target_link_libraries(netflix PRIVATE OpenMP::OpenMP_CXX spdlog::spdlog)

add_executable(steam src/app/Steam.cpp)
target_include_directories(steam PRIVATE src/include)
target_link_libraries(steam PRIVATE OpenMP::OpenMP_CXX spdlog::spdlog)

add_executable(yahoomusic src/app/YahooMusic.cpp)
target_include_directories(yahoomusic PRIVATE src/include)
target_link_libraries(yahoomusic PRIVATE OpenMP::OpenMP_CXX spdlog::spdlog)

add_executable(yahoomusicbig src/app/YahooMusicBig.cpp)
target_include_directories(yahoomusicbig PRIVATE src/include)
target_link_libraries(yahoomusicbig PRIVATE OpenMP::OpenMP_CXX spdlog::spdlog)

add_executable(yelp src/app/Yelp.cpp)
target_include_directories(yelp PRIVATE src/include)
target_link_libraries(yelp PRIVATE OpenMP::OpenMP_CXX spdlog::spdlog)

add_executable(t1 test.cpp)

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
    SET(CMAKE_CXX_FLAGS "-Ofast -DNDEBUG -std=c++11 -DHAVE_CXX0X -fopenmp -march=native -fpic -ftree-vectorize")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    SET(CMAKE_CXX_FLAGS "-Ofast -lrt -DNDEBUG -std=c++11 -DHAVE_CXX0X -fopenmp -march=native -fpic -w -fopenmp -ftree-vectorize -ftree-vectorizer-verbose=0")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
    SET(CMAKE_CXX_FLAGS "-Ofast -lrt -DNDEBUG -std=c++11 -DHAVE_CXX0X -fopenmp -march=native -fpic -w -fopenmp -ftree-vectorize")
endif ()

